﻿using System;
using System.Collections.Generic;
using System.Text;
using NetworkLib.Utilities;

namespace PokemonBattle.RoomList.Client
{
    public class Room
    {
        public int Identity;
        public string Name;
        public string Description;
        public byte MaxUser;
        public byte UserCount;
        public string Address;

        public void WriteToByteArray(ByteArray byteArray)
        {
            byteArray.WriteInt(Identity);
            byteArray.WriteUTF(Name);
            byteArray.WriteUTF(Description);
            byteArray.WriteByte(MaxUser);
            byteArray.WriteByte(UserCount);
            byteArray.WriteUTF(Address);
        }

        public void ReadFromByteArray(ByteArray byteArray)
        {
            Identity = byteArray.ReadInt();
            Name = byteArray.ReadUTF();
            Description = byteArray.ReadUTF();
            MaxUser = byteArray.ReadByte();
            UserCount = byteArray.ReadByte();
            Address = byteArray.ReadUTF();
        }
    }
}
